package com.mega.timestop;

import com.mega.timestop.item.ItemTimeClock;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod(modid = MegaTImeStopMod.MODID, name = MegaTImeStopMod.NAME, version = MegaTImeStopMod.VERSION)
public class MegaTImeStopMod
{
    public static final String MODID = "megatimestop";
    public static final String NAME = "TimeStop Mod";
    public static final String VERSION = "1.4";
    public static Item item = new ItemTimeClock();

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        MinecraftForge.EVENT_BUS.register(this);
    }

    @SubscribeEvent
    @SideOnly(Side.CLIENT)
    public void registerModels(ModelRegistryEvent event) {
        ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("megatimestop:timeclock", "inventory"));
    }

    @SubscribeEvent
    public void registerItem(RegistryEvent.Register<Item> event) {
        event.getRegistry().registerAll(item);
    }
}
